<template>
    <div>
        <input type="text" v-model="mytext">
        <ul>
            <li v-for="data in computedList" :key="data">{{ data }}</li>
        </ul>
    </div>
</template>

<script>
import { computed, reactive, toRefs,ref } from 'vue'
export default {
    setup() {
        const state = reactive({
            mytext: '',
            datalist:['aaa','bbb','ccc','ddd','eee',]
        })
        const computedList = computed(() => state.datalist.filter(item => item.includes(state.mytext)));
        
        return {
            ...toRefs(state),
            computedList,
        }
    }
}
</script>